#ifndef _GOVT_EMOTION_HPP_
#define _GOVT_EMOTION_HPP_

/*******************************************************************************
 ** Government Sanctioned Espionage RPG                                       **
 ** http://www.government-sanctioned.us/                                      **
 **===========================================================================**
 ** Name:emotion.hpp                                                          **
 ** Description: Basic affective emotive components.                          **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 ** The contents of this file are subject to the terms of the                 **
 ** Common Development and Distribution License, Version 1.0 only             **
 ** (the "License").  You may not use this file except in compliance          **
 ** with the License.                                                         **
 **                                                                           **
 ** You can find a copy of the license in the LICENSE file within             **
 ** this distribution or at $WIKI/display/GOVT/License-software.              **
 ** Software distributed under the License is distributed on an "AS IS"       **
 ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.           **
 ** See the License for the specific language governing permissions           **
 ** and limitations under the License.                                        **
 **                                                                           **
 ** When distributing Covered Code, include this CDDL header in each          **
 ** file and include the License file at $GAME_DIR/LICENSE.                   **
 ** If applicable, add the following below this header, with the indicated    **
 ** fields enclosed by brackets "[]" replaced with your own identifying       **
 ** information: Portions Copyright [yyyy] [name of copyright owner]          **
 **                                                                           **
 ** Copyright (c) 2009-2012  Barry Gian James <gian@gamingods.net>            **
 ** All rights reserved.                                                      **
 ******************************************************************************/
// $HeadURL$
// Modified $Date$ by $Author$
// $Id$
// JIRA GOVT-105 Issue: Implement affective NPCs

// Much/most of the ideas in this area are liberally taken directly from the
// combined works found in the primary literature.

#include "common.hpp"
#include "fuzzy.hpp"

enum class EmotionCategoryLabel
{
	Undefined = 0x00000000,
	Joy = 0x00000001,	// PLEASED about an EVENT
	Distress = 0x00000002,	// DISPLEASED about an EVENT
	HappyFor = 0x00000004,	// PLEASED about an EVENT DESIRABLE for another
	Gloating = 0x00000008,	// PLEASED about an EVENT UNDESIRABLE for another
	Resentment = 0x00000010,	// DISPLEASED about an EVENT DESIRABLE for another
	Jealousy = 0x00000020,	// RESENTMENT over a DESIRED mutually exclusive goal
	Envy = 0x00000040,	// RESENTMENT over a DESIRED non=exclsive goal
	SorryFor = 0x00000080,	// DISPLEASED about an EVENT UNDESIRABLE for another
	Hope = 0x00000100,	// PLEASED about a prospective DESIRABLE EVENT
	Fear = 0x00000200,	// DISPLEASED about a prospective UNDESIRABLE EVENT
	Satisfaction = 0x00000400,	// PLEASED about a confirmed DESIRABLE EVENT
	Relief = 0x00000800,	// PLEASED about a disconfirmed UNDESIRABLE EVENT
	FearsConfirmed = 0x00001000,	// DISPLEASED about a confirmed UNDESIRABLE EVENT
	Disappointment = 0x00002000,	// DISPLEASED about a disconfirmed DESIRABLE EVENT
	Pride = 0x00004000,	// APPROVING of one's own ACT
	Admiration = 0x00008000,	// APPROVING of another's ACT
	Shame = 0x00010000,	// DISAPPROVING of one's own ACT
	Reproach = 0x00020000,	// DISAPPROVING of another's ACT
	Liking = 0x00040000,	// finding an OBJECT APPEALING
	Disliking = 0x00080000,	// finding an OBJECT UNAPPEALING
	Gratitude = (Admiration|Joy),
	Anger = (Reproach|Distress),
	Gratification = (Pride|Joy),
	Remorse = (Shame|Distress),
	Love = (Admiration|Liking),
	Hate = (Reproach|Disliking)
};

enum class EmotionCategoryGroup
{
	Undefined = 0x00,
	WellBeing = 0x01,	// APPRAISAL of a SITUATION as an EVENT
	OthersFortunes = 0x02,	// PRESUMED value of a SITUATION as an EVENT affecting other
	Prospects = 0x04,	// APPRAISAL of a SITUATION as a PROSPECTIVE EVENT
	Confirmation = 0x08,	// APPRAISAL of a SITUATION as CONFIRMING or DISCONFIRMING EXPECTATION
	Attribution = 0x10,	// APPRAISAL of a SITUATION as an accountable ACT of some agent
	Attraction = 0x20,	// APPRAISAL of a SITUATION as containing an ATTRACTIVE or UNATTRACTIVE OBJECT
	Compound = (WellBeing|Attribution),	// Compound emotions
	CompoundExtended = (Attraction|Attribution)	// compound emotion extensions
};

class EmotionalDisposition
{
public:
	EmotionalDisposition() : label(EmotionCategoryLabel::Undefined), group(EmotionCategoryGroup::Undefined), object(0) { }
	EmotionalDisposition(EmotionCategoryLabel l, EmotionCategoryGroup g, entity_t o)
	: label(l), group(g), object(o) { }
	
	EmotionCategoryLabel	Label() { return label; }
	EmotionCategoryGroup	Group() { return group; }
	entity_t		Object() { return object; }

private:
	EmotionCategoryLabel	label;
	EmotionCategoryGroup	group;
	entity_t		object;
};

#endif /* _GOVT_EMOTION_HPP_ */
